Conversation
|
This PR now also accounts includes AggregateFITS. Usage: aggregate_fits = af.AggregateFITS(aggregator)
# Create a FITS (note the PrimaryHDU is empty)
hdu_list = aggregate_fits.extract_fits(
af.FitFITS.ModelImage,
af.FitFITS.ResidualMap,
)
# Output to a folder. This will create one FITS file for each search output. Note that a 'name' argument can be passed to define which attribute of the search is used to name the file
aggregate_fits.output_to_folder(
path_to_folder,
af.FitFITS.ModelImage,
af.FitFITS.ResidualMap,
) |
| ) | ||
|
|
||
|
|
||
| class FitFITS(Enum): |
There was a problem hiding this comment.
These need to be implemented for other fits files. For example, galaxy_images.fits can be included by defining GalaxyImagesFITS
|
I updated the example here: https://github.com/Jammy2211/autogalaxy_workspace/blob/main/scripts/results/examples/fits_splice.py But have two issues. Firstly, I can run this code: But I see that Secondly, I don't follow the But got this error: I think the behaviour should be the following: So here, I am telling it to use If |
|
The PR also required me to update PyAutoGalaxy but I didnt fix aggregator related unit tests: |
|
self._hdus is a method to extract the hdus corresponding to the enum values. extract_fits takes enum args and returns a single FITS object comprising all matching HDUs from all searches. output_to_folder takes enum args and creates a FITS file for each search which includes HDUs from that search corresponding to enum args. This is exactly the same behaviour as provided by AggregateImages |
|
I've fixed the error. Currently the output in both AggregateImages and AggregateFITS is to use the 'name'. We can change that to the unique_tag if you think that's better? |
|
I think we should make We should rename the variable, as I think we should add a method which allows a user to see the full list of names that will be used, so something like: Maybe |
Will we definitely a custom list? Seems like overkill? We could log what names are being used? I can only see this being something a user wants to check beforehand if the process of aggregation is going to take a considerable length of time |
|
The problem I see is if a user didn't set up For example, they could use the name of the search, or some splicing of I am happy to avoid a custom list for now if its particularly burdensome for the source code. |
|
No it's not so bad. There's always the identifier which should be unique per search but isn't human readable |
|
I guess another point is do they even know what order the searches are in? If not then a list doesn't make a lot of sense? |
|
I guess they'd have to use the list to work out the order and then customize it lol. I am happy to avoid the list, I will make sure documnetation and the like means a user understands that they need to setup |
|
I wouldn't have a default value though as I think forcing the user to think about this is good. |
|
Cool will remove the default |
Doesn't implement HDU splicing but implements crucial fix that loads whole fits rather than just primary HDU. This may not be completely backwards compatible